package com.twu.biblioteca;

/**
 * Created by abhishep on 3/5/14.
 */
public class MovieMenu extends MenuClass {

    public MovieMenu(Formatter formatter) {
        super(formatter);
    }

    @Override
    public void showMenu() {
        formatter.outputMessageToConsole("1.List Movies  2.CheckOut Movie  3.Return Movie  4.Back");
    }

    public void getMovieName()
    {
        formatter.outputMessageToConsole("Enter the movie :");
    }

    @Override
    public String menuAction(Library library,int choice)
    {
        switch(choice)
        {
            case 1:

                return library.getMovies();
            case 2:
                getMovieName();
                String name = getUserInput();
                return library.checkoutMovie(name);

            case 3:
                getMovieName();
                name = getUserInput();
                return library.returnMovie(name);

            case 4: return "Going to Main Menu";

            default:
                return "Not a valid option";
        }
    }
}
